package android07.newtop.model;

import java.io.File;
import java.io.IOException;

import android07.newtop.app.APP;
import android07.newtop.model.bean.NewsBean;
import android07.newtop.model.bean.WeatherInfoBean;
import android07.newtop.utils.JUtils;
import okhttp3.Cache;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;


/**
 * 获取天气信息的Model
 */
public class WeatherBeanModel {


    /**
     * 获取天气信息
      * @param cityname 城市名字
     *在
     * @param callback
     */
    public void getWeatherInfoBeanList(String cityname, Callback<WeatherInfoBean> callback) {

        ApiService service = Retrofit2Util.getRetrofit("http://op.juhe.cn/").create(ApiService.class);
        //0bea21e7f8fce3d6250b25ccceca7e59 这个是后台的识别码，有聚合数据后台可以得到
        Call<WeatherInfoBean> call = service.getWeatherInfoBeanList(cityname,"280f0bbf633358fb1d5755fca03eaccb");
        call.enqueue(callback);
    }



}
